using System;


namespace MyPwdGenerator
{
    public class PasswordGenerator
    {

        public PasswordGenerator()
        { }

        public string Generate()
        {


            // uses linear congruential generator to create a different password for 

            // every day of the year. Can easily enhance to generate a different password 

            // for every day indpendent of year but will have to chose new paramaters. (32, 7, 62) 

            string utcMonth = DateTime.UtcNow.ToString("MM");

            string utcDay = DateTime.UtcNow.ToString("dd");

            int dVal = Int32.Parse(utcDay.ToString());

            int mVal = Int32.Parse(utcMonth.ToString());


            string charSet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

            string pwd = "";

            int[] randomList = new int[9];
            randomList[0] = dVal + mVal;


            for (int i = 1; i < 9; i++)
            {

                randomList[i] = (32 * randomList[i - 1] + 7) % 62;

                pwd += charSet[randomList[i]];

            }


            return pwd;
        }

    }
}
